﻿<!--#include file="admin/Includes/constants.asp"-->
<!--#include file="admin/Includes/validate.asp"-->
<%
Dim ArticleID, SubCatName
Dim aData, hasData, TDalign
Dim aData2, nRows2, rCount2, hasData2
Dim aData3, nRows3, rCount3, hasData3
Dim aData4, nRows4, rCount4, hasData4

Dim fYear, MainCatName

ArticleID=request("aid")

strSQL = "{CALL a_detail_print ("& ArticleID &")}"	
exec(strsql)

	If Not RS Is Nothing Then
	If Not RS.EOF Then
		aData = RS.getrows		
		hasData=True			
		fYear = aDAta(10,0)
		MainCatName = aDAta(11,0)		
	End If
		Set RS=RS.NextRecordSet
	End If
	
	'Images
	If Not RS Is Nothing Then
	If Not RS.EOF Then		
		aData2 = RS.getrows		
		nRows2 = Ubound(aData2,2)
		hasData2=True		
	End If
		Set RS=RS.NextRecordSet
	End If	
	
	'Newer Articles
	If Not RS Is Nothing Then
	If Not RS.EOF Then		
		aData3 = RS.getrows		
		nRows3 = Ubound(aData3,2)
		hasData3=True				
	End If		
		Set RS=RS.NextRecordSet
	End If	
	
	'Older Articles
	If Not RS Is Nothing Then
	If Not RS.EOF Then		
		aData4 = RS.getrows		
		nRows4 = Ubound(aData4,2)
		hasData4=True				
	End If			
	End If	
	
	If aData(5,0) <> "" Then
	SubCatName=replace(aData(5,0)," ","-")
	End If
	
	Set RS = Nothing
	Set cmd = Nothing
	objConn.Close
	Set objConn = Nothing
	
If hasData Then
InitArticleNaming

%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
	<meta name="robots" content="noindex,nofollow">
	<meta http-equiv="imagetoolbar" content="no">
	<meta http-equiv="imagetoolbar" content="false">
	<meta http-equiv="content-type" content="text/html; charset=utf-8">
	<meta http-equiv=" content-language" content ="vi">		
	<title><%= aData(1,0) %></title>	
	<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> 
	<link rel="icon" href="favicon.ico" type="image/x-icon"> 
	<link rel="STYLESHEET" type="text/css" href="system/styles.css">
	<style type="text/css">
	#maincontent{background:url(hinh-thoi-trang/bg2.gif) center #323232 repeat-y;height:700px auto;}
	body { background: #323232;}
	#bt2 {margin-left:0px;}
	</style>	
	<script language="JavaScript" type="text/javascript" src="admin/javascripts/handler.js"></script>	
</head>
<body>
<div id="bt2"><img src="hinh-thoi-trang/bg_top2.gif" width="578" height="20"></div>
<div id="maincontent" >
<table border="0" cellpadding="0" cellspacing="0" align="center" >	
<tr bgcolor="#000000">
		<td colspan="3">
			<table border="0" cellpadding="0" cellspacing="0">
			<tr>
				<td><a href="<%= leftmenu%>index.asp?ckid=<%= ckid %>"><img src="<%=seo_mode_img%>/thoi-trang-logo.gif" width="200" height="100" border="0" alt="thoi trang .com logo"></a></td>
				<td align="right" valign="middle">&nbsp;</td>
			</tr>
			</table>
		</td>
	</tr>
	<tr bgcolor="#6b5a60"><td colspan="3"><img src="<%=seo_mode_img%>/de_clear.gif" width="1" height="1" border="0"></td></tr>
	<tr bgcolor="#000000"><td colspan="3"><img src="<%=seo_mode_img%>/de_clear.gif" width="1" height="6" border="0"></td></tr>
	
	<tr bgcolor="#6b5a60">
		<td width="522" valign="top">		
		<!--body content-->		
			<!--cover-->		
		<table border="0" cellpadding="0" cellspacing="1" width="100%" bgcolor="#B6A8AD">			
			<tr><td style="padding-left:12px;"><img src="hinh-thoi-trang/<%=SubCatName%>-hp.gif" width="400" height="40"></td><td  valign="middle"><img src="hinh-thoi-trang/btn_print.gif" alt="In Trang" width="82" height="17" border="0" align="absmiddle" onClick="printit();"></td></tr>
			<tr>
				<!--col left-->		
				<td valign="top" colspan="2">
					<table cellpadding="0" cellspacing="0" border="0" bgcolor="#B6A8AD">				
					<!--Product Listings-->
					<% 	
					Dim c_ColPerRow, c_StartCel, c_EndCel, c_nFillCels, c_isRowEnd, c_DataTotal, c_Count, c_arrData
					Dim tdcolor, Image		
					If hasData And hasData2 And nRows2 => 0 Then 
					
					'Assign variables
					c_ColPerRow = 2
					c_DataTotal = nRows2
					c_Count = rCount2											
					'system-calculations----------------------------------------------
					If (c_DataTotal) Mod c_ColPerRow > 0 Then
						c_EndCel = (Int(((c_DataTotal)/c_ColPerRow))+1)*c_ColPerRow
					Else
						c_EndCel = c_DataTotal
					End If						
					'system-calculations----------------------------------------------			
					'response.write c_endcel
					tdcolor = "align=""right"""
					
					For c_Count = 0 To c_EndCel 	
						'response.write "c_Count = " & c_Count & "<br>"
						If c_Count = 0 Then 
						Image = getNameImage (getPrefixName(fYear, aData(1,0)) , ImgDet, ArticleID , aData2(0,c_Count) )						
						%>					
						<tr bgcolor="#FFFFFF">						
							<td valign="top" style="padding-right:15px;padding-left:15px;padding-top:10px;" colspan="2"><h5><img src="hinh-anh-nguoi-mau/<% If hasData2 and aData(1,c_Count) <> "" Then %><%=Image %><% Else %>de_clear.gif<% End If %>" alt="<%= aData(1,c_Count) %>" Title="<%= aData(1,c_Count)%>" vspace="6" align="left" style="margin-right:15px;"><b class="dtTitle"><%=aData(0,c_Count)%></b><br><img src="hinh-thoi-trang/de_clear.gif" alt="" width="1" height="10" border="0"><br><%= aData(3,c_Count) %>
							<br><img src="hinh-thoi-trang/de_clear.gif" alt="" width="1" height="10" border="0"><br>
							<div style="color:#7C6787;font-size:10px" align="right"><%= aData(2,c_Count) %></div>
							<img src="hinh-thoi-trang/de_clear.gif" alt="" width="1" height="3" border="0"><br>
							<hr style="border-top-style:dashed;border-bottom-style:dashed;color:#B6A8AD;height:1px">
							<div align="right"><a href="emailFriend.asp?ckid=<%=ckid%>"><img src="hinh-thoi-trang/btn_senddoc.gif" alt="Gởi trang này" border="0" style="margin-left:5px; margin-top:5px"></a></div>
							</h5></td>
						</tr>					
						<tr bgcolor="#ffffff"><td colspan="2"><img src="hinh-thoi-trang/de_clear.gif" alt="" width="1" height="10" border="0"></td></tr>
						<tr bgcolor="#B6A8AD"><td colspan="2"><img src="hinh-thoi-trang/de_clear.gif" alt="" width="1" height="10" border="0"></td></tr>
						
						<!--system header-->
						<tr bgcolor="#B6A8AD">					
							<td colspan="2" align="center">
							<table border="0" cellpadding="0" cellspacing="1">		
								<!--top border line-->	
								<tr>
					<!--/system header-->					
					<% 	Else												
								'system--------------------------------
								If ((c_Count) Mod c_ColPerRow)=0 Then
									c_isRowEnd = True
								End If
								'system--------------------------------	
								If ((c_Count) Mod 2)=0 Then
									tdcolor = "style=""padding-left:3px;"""
									TDalign = "align=""left"""
								Else
									tdcolor = "align=""right"""
									TDalign = "align=""left"" style=""padding-left:3px;"""
								End If							
								'Write data Start
								If c_Count <= c_DataTotal Then 'Real Data
									'Image = Replace(aData(1,0)," ","-") & "-d" & ArticleID & "-" & aData2(0,c_Count) 
									Image = getNameImage (getPrefixName(fYear, aData(1,0)) , ImgDet, ArticleID , aData2(0,c_Count) )
									%>							
									<td valign="top" <%= tdcolor %> width="50%"><img src="hinh-anh-nguoi-mau/<%= Image %>" border="0" vspace="3" hspace="3" alt="<%= aData2(1,c_Count) %>" title="<%= aData2(1,c_Count) %>"><br><h5 class="imgTitle" <%= TDalign %>><%=aData2(1,c_Count)%></h5></td>								
							<%	Else 'Fill Cells
									response.write "<td " & tdcolor & " width=""50%"">&nbsp;</td>" & vbcrlf	
								End If
								'Write data End							
								'system-------------------------------
								If c_isRowEnd Then							
									response.write "</tr>" & vbcrlf		
									If c_Count < c_EndCel Then
										response.write "<tr>" & vbcrlf	
									End If								
									c_isRowEnd = False
								End If								
								'system-------------------------------										
						End If					
								Next %>							
					<!--system footer-->	
							</tr>

<%						dim ImageW, sAvatarO, sAvatarC, strAction
						If hasData3 Then
						 	For rCount3 = 0 To nRows3 
							'Image = Replace(aData(1,0)," ","-") & "-d" & ArticleID & "-" & aData3(0,rCount3) & ".jpg"
							Image = getNameImage (getPrefixName(fYear, aData(1,0)) , ImgDet, ArticleID , aData3(0,rCount3) )
							
							If aData3(2,rCount3) <> "" Then
									ImageW=aData3(2,rCount3)
								Else
									ImageW="506"
								End If	
							%>	
							<tr>
								<td colspan="2" align="center">
									<img src="hinh-anh-nguoi-mau/<%= Image %>" border="0" alt="<%= aData3(1,rCount3) %>" title="<%= aData3(1,rCount3) %>">
								</td>
							</tr>
							<%	Next 
						End If%>
						
													
						</table>
						</td>
					</tr>
					<!--/system footer-->	
					<% 	End If		%>
					<tr bgcolor="#000000"><td colspan="2"><img src="hinh-thoi-trang/de_clear.gif" alt="" width="1" height="1" border="0"></td></tr>
					<tr><td colspan="2" align="right" style="padding-right:15px;"><a href="emailFriend.asp?ckid=<%=ckid%>"><img src="hinh-thoi-trang/btn_senddoc.gif" alt="Gởi trang này" border="0" style="margin-left:5px; margin-top:5px"></a></td></tr>				
					
				<!--/Product Listing-->	
					<tr bgcolor="#B6A8AD"><td colspan="2"><img src="hinh-thoi-trang/de_clear.gif" alt="" width="1" height="10" border="0"></td></tr>
					</table>
				</td>
				<!--/col left-->							
			</tr>
		</table>
			<!--/text-->		
		<!--/body content-->
		</td>
		<td style="width:0px;"><img src="hinh-thoi-trang/de_clear.gif" alt="" width="1" height="1" border="0"></td>
	</tr>
	<!--/main body-->
	
<tr><td bgcolor="#999999" colspan="3"><img src="<%=seo_mode_img%>/de_clear.gif" width="1" height="1" border="0"></td></tr>
	<tr bgcolor="#6b5a60">
		<td valign="bottom" height="55" colspan="3">
			<table cellpadding="0" cellspacing="0" border="0">
			<tr><td class="NavBottom" height="18"><a href="<%= leftmenu%>aboutus.asp" class="NavBottom">Giới thiệu</a>&nbsp;<a href="<%= leftmenu%>useragreement.asp" class="NavBottom">Thỏa thuận</a>&nbsp;<a href="<%= leftmenu%>privacypolicy.asp" class="NavBottom">Bảo mật</a>&nbsp;Bản quyền ©<%= strYear %> ThoiTrang.com </td></tr>
			<tr><td class="NavBottom" style="padding-bottom:10px;"><a href="http://www.megaleap.com/" target="new" class="NavBottom">Web design and development</a>by Megaleap.com &nbsp;Tựa đề: <%= seo_Title %></td></tr>
			</table>
		</td>
	</tr>	
</table>
</div>
<div id="bt2"><img src="hinh-thoi-trang/bg_bottom2.gif" width="578" height="20"></div>
</body>
</html>
<% End If 
DisposeArticleNaming
%>